<script type="text/javascript">
    layui.use('upload', function () {
        var upload = layui.upload;
        //执行实例
        var uploadInst = upload.render({
            elem: '#img_file', //绑定元素
            url: '/asset/img-upload', //上传接口
            done: function (res) {
                if (data.status == 0) {
                    $('#slide_img').attr('src', data.data.file);
                    $('#img_url').val(data.data.file);
                }
            },
            error: function () {
                alert("upload error");
            }
        });
    });

</script>
